<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
        while(条件成立){
            执行循环体
        }

        继续执行主干代码
        */
    </script>

    <script>
        console.log("走进教室");

        /* 只要条件满足 就执行一遍循环体 否则结束循环继续向后执行*/
        var kongtiaoOk = false
        while(kongtiaoOk === false){
            //执行循环体
            console.log("我热shi了");

            // 务必确保循环条件动态变化（否则循环条件永远成立=>死循环=>死机/程序崩溃）
            kongtiaoOk = (Math.random()>0.9)
            console.log("kongtiaoOk",kongtiaoOk);
        }

        console.log("开始学习");
    </script>

</body>
</html>